<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:58:"D:\phpStudy\WWW\auth/application/web\view\agent\index.html";i:1496201802;s:58:"D:\phpStudy\WWW\auth/application/web\view\public\base.html";i:1496201802;s:56:"D:\phpStudy\WWW\auth/application/web\view\agent\top.html";i:1496201818;}*/ ?>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="renderer" content="webkit">
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<title>商家后台管理</title>
		<meta name="keywords" content="">
		<meta name="description" content="">
		<!--[if lt IE 9]>
    	<meta http-equiv="refresh" content="0;ie.html" />
    	<![endif]-->
		<link rel="shortcut icon" href="favicon.ico">
		<link href="__CSS__/bootstrap.min.css" rel="stylesheet">
		<link href="__CSS__/font-awesome.min.css" rel="stylesheet">
		<link href="__CSS__/animate.min.css" rel="stylesheet">
		<link href="__CSS__/style.min.css" rel="stylesheet">
		<link href="__CSS__/admin.css" rel="stylesheet"><link href="__LIB__/fileinput/css/fileinput.min.css" rel="stylesheet" /> 
	</head>
	<style>
		.lactive {
			background: #293846;
			color: #FFFFFF;
			border-bottom: solid 2px #1ab394
		}
		
		.lactive> a {
			color: #ffffff!important;
		}
	</style>

	<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
		<div id="wrapper">
			<!--左侧导航开始-->
			<div class="navbar_top_nav">
				<ul class="nav navbar-top-links navbar-left">
					<li class="nspecial">
						<span class="block m-t-xs"><strong class="font-bold">
							<?php echo session('storeInfo')['store_name']; if($chainsotrename!==''): ?>
							(<?php echo $chainsotrename; ?>)
							<?php endif; ?>
						</strong></span>
					</li>
					<li class="hidden-xs" id='shouye'>
						<a href="<?php echo url('index/index'); ?>">
							&nbsp;&nbsp;<i class="fa fa-home"></i>首页&nbsp;&nbsp;
						</a>
					</li>
					<?php if(is_array($store_top_menus) || $store_top_menus instanceof \think\Collection): if( count($store_top_menus)==0 ) : echo "" ;else: foreach($store_top_menus as $key=>$st): ?>
					<li id="top_menu<?php echo $st['id']; ?>">
						<a href="/<?php echo $st['name']; ?>?top_menu_id=<?php echo $st['id']; ?>"><i class='<?php echo $st['icon']; ?>'></i><?php echo $st['title']; ?></a>
					</li>
					<?php endforeach; endif; else: echo "" ;endif; ?>
				</ul>
				<ul class="nav navbar-top-links navbar-right">
					<li class="hidden-xs">
						<a href="/help" target="_blank">
							<i class="fa fa-chain"></i>帮助文档
						</a>
					</li>

					<li class="hidden-xs">
							<a data-toggle="dropdown" href="#">
								<i class="fa fa-chain"></i>系统管理<b class="caret"></b>
							</a>
							<ul class="dropdown-menu animated fadeInRight m-t-xs">
								<li>
									<a onclick="jiaoban()" }>
										<i class="fa fa-chain"></i>交班
									</a>
								</li>
								<li class="divider"></li>
								<li>
									<a href="<?php echo url('index/clear'); ?>">
										<i class="fa fa-refresh"></i>清除缓存
									</a>
								</li>
								<li>
									<a href="<?php echo url('login/logout'); ?>"><i class="fa fa-sign-out"></i>退出系统</a>
								</li>
							</ul>
					</li>
				</ul>

			</div>
			<nav class="navbar-default navbar-static-side" role="navigation" style="margin-top: 60px;">

				<div class="sidebar-collapse">
					<ul class="nav" id="side-menu">

						<li class="menu" style="text-align: center; background-color:#08575B;">
							<a class="navbar-minimalize" href="#" style="text-align: center; background-color:#08575B;">
								<i class="fa fa-bars"></i>
							</a>
						</li>
						<?php if(!empty($menu)): if(is_array($menu) || $menu instanceof \think\Collection): if( count($menu)==0 ) : echo "" ;else: foreach($menu as $key=>$vo): ?>
						<li class="menu" style="text-align:left">
							<a href="/<?php echo $vo['name']; ?>?top_menu_id=<?php echo $top_menu_id; ?>">
								<i class="<?php echo $vo['icon']; ?>" style="width: 15px;"></i>
								<span class="nav-label"><?php echo $vo['title']; ?>&nbsp;&nbsp; </span>
							</a>
						</li>
						<?php endforeach; endif; else: echo "" ;endif; endif; ?>
					</ul>
				</div>
			</nav>
			<!--左侧导航结束-->
			<!--右侧部分开始-->
			<div id="page-wrapper" class="gray-bg dashbard-1">
				<div class="row border-bottom" style="display: none;">
					<nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0;">
						<div class="navbar-header">
							<a class="navbar-minimalize " href="#">
							</a>
						</div>

					</nav>
				</div>
				<div class="row" style="margin-top: 66px;">
					
 <div class="content-tabs">
	<ol class="breadcrumb">
		<li>
			<a href="<?php echo url('index/index'); ?>"><i class="fa fa-home"></i></a>
		</li>
		<li><strong>站点配置</strong></li>
	</ol>
</div>
<div class="row">
	<div class="col-sm-12">
		<div class="ibox float-e-margins">
			<div class="ibox-title">
	<ul class="nav nav-tabs">
		<li id="li-bar-index">
			<a href="<?php echo url('agent/index'); ?>">店铺设置</a>
		</li>
		<li id="li-bar-card">
			<a href="<?php echo url('agent/card'); ?>">证件信息</a>
		</li>
		<li id="li-bar-other">
			<a href="<?php echo url('agent/other'); ?>">其他</a>
		</li>
		<!--<li id="li-bar-bond">
			<a href="<?php echo url('agent/bond'); ?>">保证金</a>
		</li>-->
		
		<li id="li-bar-goodsattr">
			<a href="<?php echo url('agent/goodsattr'); ?>">商品自定义属性</a>
		</li>
	</ul>
</div>
			<div class="ibox-content">
				<form id="myForm" class="form-horizontal m-t" method="post" action="<?php echo url('index'); ?>">
				<input type="hidden" name="id" value="<?php echo $ad['id']; ?>" />
				<!--店铺基本信息-->
				<div class="form-group">
					<label class="col-sm-2 control-label">名称：</label>
					<div class="input-group col-sm-4">
						<input type="text" id="store_name" name="store_name" value="<?php echo $ad['store_name']; ?>"  class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">地理位置：</label>
					<div class="input-group col-sm-10">
						<div class="row">
                                <div class="col-md-2">
                                    <input type="text" id="longitude" name="longitude" value="<?php echo $ad['longitude']; ?>" placeholder="所在经度" class="form-control">
                                </div>
                                <div class="col-md-2">
                                    <input type="text" id="latitude" name="latitude" value="<?php echo $ad['latitude']; ?>" placeholder="所在纬度" class="form-control">
                                </div>
                                <div class="col-md-6">
                                	<div class="input-group">
                                    <input type="text" id="address" name="address" value="<?php echo $ad['address']; ?>" placeholder="店铺位置" class="form-control">
                                    <span class="input-group-btn"> <button type="button" onclick="show_map()" class="btn btn-primary">选择坐标
                                    </button> </span>
                           		 </div>
                                    
                                </div>
                        </div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">首页链接：</label>
					<div class="input-group col-sm-4">
						<img src="<?php echo $code_url; ?>" width="140px"/>
						<input type="text" name="" class="form-control" value="<?php echo $url; ?>" readonly/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">LOGO：</label>
					<div class="input-group col-sm-4">
						<input type="hidden" id="store_logo" name="store_logo"  value="<?php echo $ad['store_logo']; ?>"/>
						<input id="upload" name="upload" type="file" />
					</div>
				</div>
				
				<div class="form-group">
					<label class="col-sm-2 control-label">电话：</label>
					<div class="input-group col-sm-4">
						<input type="text" id="store_tel" name="store_tel" value="<?php echo $ad['store_tel']; ?>"  class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">店铺性质：</label>
					<div class="input-group col-sm-4">
						<select class="form-control" name="store_property">
							<option>请选择店铺性质</option>
							<option value="1" <?php if($ad['store_property'] == 1): ?>selected<?php endif; ?>>个人</option>
							<option value="2" <?php if($ad['store_property'] == 2): ?>selected<?php endif; ?>>商家</option>
							<option value="3" <?php if($ad['store_property'] == 3): ?>selected<?php endif; ?>>厂家</option>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">经营范围：</label>
					<div class="input-group col-sm-4">
						<input type="text" id="business_scope" name="business_scope" value="<?php echo $ad['business_scope']; ?>"  class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">营业时间：</label>
					<div class="input-group col-sm-4">
						<input id='business_start' name='business_start' value="<?php echo $ad['business_start']; ?>" onclick="WdatePicker({dateFmt:'HH:mm:00'})" style="width: 190px;"  type='text' placeholder="开始时间" class="form-control layer-date" />
						<input id='business_end' name='business_end' value="<?php echo $ad['business_end']; ?>" onclick="WdatePicker({dateFmt:'HH:mm:00'})" style="width: 190px;"  type='text' placeholder="结束时间" class="form-control layer-date" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">客服电话：</label>
					<div class="input-group col-sm-4">
						<input type="text" id="service_tel" name="service_tel" value="<?php echo $ad['service_tel']; ?>"  class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">客服QQ：</label>
					<div class="input-group col-sm-4">
						<input type="text" id="service_qq" name="service_qq" value="<?php echo $ad['service_qq']; ?>"  class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">客服微信：</label>
					<div class="input-group col-sm-4">
						<input type="text" id="service_Wechat" name="service_Wechat" value="<?php echo $ad['service_Wechat']; ?>"  class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">状态：</label>
					<div class="input-group col-sm-8">
						<label class="checkbox-inline h5">
                            <input type="radio" name="store_state" value="1" <?php if($ad['store_state']==1): ?> checked<?php endif; ?>> 开启
						</label>
						<label class="checkbox-inline h5">
                            <input type="radio" name="store_state" value="0" <?php if($ad['store_state']==0): ?> checked<?php endif; ?>> 关闭
						</label>
					</div>	
				</div>	
				 <!--店铺基本信息end-->
					
				<div class="form-group">
						<div class="col-sm-4 col-sm-offset-3">
							<button class="btn btn-primary" type="submit"><i class="fa fa-save"></i> 保存</button>
						</div>
				</div>
				</form>
			</div>
		</div>
	</div>
</div>
<div class="modal-content" id="map-dialog" style="position:fixed;z-index:1000;background:#fff;left: 17%;top: 5%;right: 5%;display: none;">
				<div class="modal-header" style="padding: 5px;"><h4>请选择地点<button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="$('#map-dialog').hide()">×</button></h4></div>
				<div class="modal-body">
					<div class="form-group" style="margin-bottom: 13px;">
						<div class="input-group">
							<input type="text" id="suggestId" class="form-control" placeholder="请输入地址来直接查找相关位置">
							<div class="input-group-btn"><button class="btn btn-default"><i class="icon-search"></i> 搜索</button></div>
						</div>
					</div>
					<div id="searchResultPanel" style="z-index:2;width:300px;height:400px;position:absolute;left:30px;top:50px;"></div>
					<div id="map-container" style="height: 480px; overflow: hidden; position: relative; z-index: 0; background-color: rgb(243, 241, 236); color: rgb(0, 0, 0); text-align: left;">
					</div>
					<div class="modal-footer ">
							<a  class="btn btn-default" data-dismiss="modal" onclick="javascript:$('#map-dialog').hide()">取消</a><a onclick="setJW()"  class="btn btn-primary ">确认</a>
					</div>
				</div>
</div>

				</div>
			</div>
			<!--右侧部分结束-->
		</div>
		<div class="footer">
			<div class="pull-right"> 版权所有 Project &copy; 2017-2020 版权所有</div>
		</div>
		<script src="__JS__/jquery.min.js"></script>
		<script src="__JS__/bootstrap.min.js"></script>
		<script src="__JS__/jquery.metisMenu.js"></script>
		<script src="__JS__/jquery.slimscroll.min.js"></script>
		<script src="__LIB__/layer/layer.js"></script>
		<script src="__JS__/core.min.js"></script>
		<script src="__JS__/pace.min.js"></script>
		<script src="__JS__/autocomplete.js"></script>
		<script>
			// 文件上传URL
			var __UPLOAD_URL__ = "<?php echo url('web/upload/index'); ?>";
			var __CURRENT_URL__ = "<?php echo $current_url; ?>";
			console.log(__CURRENT_URL__);
		</script>
		<script src="__JS__/admin.js"></script>
		<script>
			var show = "<?php echo $is_show_left; ?>";
			if(show == 0) {
				$("body").toggleClass("mini-navbar"), SmoothlyMenu();
			}
		</script>
		<script>
			var top_menu_id = "<?php echo $top_menu_id; ?>";
			$(".lactive").removeClass("lactive");
			if(top_menu_id != "") {
				$("#top_menu" + top_menu_id).addClass("lactive");
			} else {
				$("#shouye").addClass("lactive");
			}
			//交班操作
			function jiaoban1() {
				layer.open({
					type: 2,
					id: "jioaban_list",
					area: ['750px', '350px'],
					title: '收入',
					scrollbar: false,
					content: '/web/index/jiaoban_list' //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
				});
			}

			function jiaoban() {
				$.ajax({
					url: '/web/index/jiaoban_list',
					data: {},
					type: "post",
					success: function(data) {
						var info = data.data;
						var html = '<div class="input-group m-b" style="width:100%;text-align: center;">' +
							'<span style="color: red;font-size: 20px;">￥' +
							'<span id="total_price" style="color: red;font-size: 50px;" class="b_rs_pan">' + info.zsr + '</span></span>' +
							'</br><span>工作时间：' + info.startime + '至' + info.endtime + '</span>' +
							'</div>' +
							'<table class="table table-bordered table-hover">' +
							'<thead>' +
							'<tr class="long-th">' +
							'<th>现金</br>￥' + info.xianjin + '</th>' +
							'<th>银行卡</br>￥' + info.yinhangka + '</th>' +
							'<th>微信</br>￥' + info.weixin + '</th>' +
							'<th>支付宝</br>￥' + info.zhifubao + '</th>' +
							'<th>自定义</br>￥' + info.zidingyi + '</th>' +
							'</tr>' +
							'</thead>' +
							'</table>';
						var index = layer.open({
							title: '确认交班',
							zIndex: "addjb",
							area: ['750px', '300px'],
							content: html,
							btn: ['确定', '取消'],
							yes: function(index, layero) {
								//按钮【按钮一】的回调
								$.ajax({
									url: '/web/index/addjb',
									data: {
										total_icome: info.zsr,
										cash: info.xianjin,
										card_icome: info.yinhangka,
										wx_icome: info.weixin,
										zfb_icome: info.zhifubao,
										zdy_icome: info.zidingyi
									},
									type: "post",
									success: function(data) {
										layer.close(index);
										callback1(data);
									}
								})
							},
							btn2: function(index, layero) {
								layer.close(index);
							}
						});
					}
				});
			}

			function callback1(data) {
				if(data.code == 200) {
					var info = data.data;
					var html = '<div>' +
						'<div style="text-align: center;">' +
						'<i class="fa fa-check" style="color: #35b12c;font-size: 60px;font-weight: 600;"></i>' +
						'<p><span class="b_rs_pan">交班成功</span> </p>' +
						'</div>' +
						'<div class="form-group" style="padding-left: 100px;"><label class="col-sm-5 control-label">交班时间：</label><div class="input-group col-sm-7">' + info.time + '</div></div>' +
						'<div class="form-group" style="padding-left: 100px;"><label class="col-sm-5 control-label">操作员：</label><div class="input-group col-sm-7">' + info.mobile + '</div></div>' +
						'<div class="form-group" style="padding-left: 100px;"><label class="col-sm-5 control-label">收入(元)：</label><div class="input-group col-sm-7">' + info.zsr + '</div></div>' +
						'</div>';
					var index = layer.open({
						title: '交班成功',
						area: ['500px', '350px'],
						content: html,
						btn: ['我知道了'],
						yes: function(index, layero) {
							layer.close(index);
						}
					});

				} else {
					layer.msg(data.msg);
					window.reload();
				}

			}
		</script>
		
<script src="__JS__/jquery.form.js"></script>
<script src="__LIB__/validate/jquery.validate.min.js"></script>
<script src="__LIB__/validate/messages_zh.min.js"></script>
<script src="__LIB__/validate/add_validate.min.js"></script>
<script src="__LIB__/fileinput/js/fileinput.min.js"></script>
<script src="__LIB__/fileinput/js/locales/zh.js"></script>
<script src="__LIB__/datepicker/WdatePicker.js"></script>

<script src="__LIB__/ueditor/ueditor.config.js" type="text/javascript"></script>
<script src="__LIB__/ueditor/ueditor.all.js" type="text/javascript"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=grTHl4v1H6uGFLChfz0aB0uQG4XWQv0k"></script>
<script>
	var lng;
	var lat;
	
	function G(id) {
	    return document.getElementById(id);
	}
   var map = new BMap.Map("map-container");
	//map.centerAndZoom(new BMap.Point(116.404, 39.915), 11);
	var point = new BMap.Point(113.023083,25.785985);
	map.centerAndZoom(point,12);
	map.enableScrollWheelZoom();   //启用滚轮放大缩小，默认禁用
	map.enableContinuousZoom();    //启用地图惯性拖拽，默认禁用
	
	var marker = new BMap.Marker(point);// 创建标注
	map.addOverlay(marker);    // 将标注添加到地图中
	marker.enableDragging();
	function showInfo(e){
		//alert(e.point.lng + ", " + e.point.lat);
		//var pt=market.getPosition();
		var pt=e.point;
		var geoc = new BMap.Geocoder();    
		geoc.getLocation(pt, function(rs){
			var addComp = rs.addressComponents;
			var address=addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber;
			$("#suggestId").val(address);
			lng=e.point.lng;
			lat=e.point.lat;
		});        
		
	}
	var opts = {
	  offset   : new BMap.Size(60, -60)    //设置文本偏移量
	}
	var label = new BMap.Label("移动红色图标标记位置", opts);  // 创建文本标注对象
		label.setStyle({
			 color : "red",
			 fontSize : "18px",
			 height : "40px",
			 fontWeight:"700",
			 lineHeight : "40px",
			 fontFamily:"微软雅黑"
		 });
	marker.setLabel(label);
	marker.setAnimation(BMAP_ANIMATION_BOUNCE);
	marker.addEventListener("dragend", showInfo);
	map.addEventListener("click", showInfo);
	var size = new BMap.Size(10, 20);
	map.addControl(new BMap.CityListControl({
	    anchor: BMAP_ANCHOR_TOP_LEFT,
	    offset: size,
	    // 切换城市之间事件
	    // onChangeBefore: function(){
	    //    alert('before');
	    // },
	    // 切换城市之后事件
	    // onChangeAfter:function(){
	    //   alert('after');
	    // }
	}));
	var numb=0;
	function show_map(){
		$('#map-dialog').show();
		numb=0;
		setInterval(function(){
			if(numb==0){
				numb=1;
				map.panTo(marker.getPosition());
			}
		},500);
	}
	
	function setJW(){
		$("#longitude").val(lng);
		$("#latitude").val(lat);
		$("#address").val($("#suggestId").val());
		map.panTo(marker.getPosition());
		$('#map-dialog').hide();
	}
	//编辑器
	var ueditor = UE.getEditor('content');
	//顶部导航
	$("#li-bar-index").addClass("active");
	upload_one('<?php echo $ad['store_logo']; ?>');
	$(function() {
		$("#myForm").validate({
			rules: {
				store_name: "required",
				address: "required"
			},
			messages: {
				store_name: ICON.error + "请输入名称",
				address: ICON.error + "请输入地址"
			},
			submitHandler: function(form) {
				ajaxForm();
			}
		});
	});
</script>

	</body>

</html>